<template>
	<view class="pannel" @click="openPage">
		<view class="pannel-img">
			<swiper v-if="item.imgList.length>1" class="pannel-swiper">
				<swiper-item class="swiper-item" v-for="(el, index) in item.imgList" :key="index">
					<view class="swiper-wrap"><image class="swiper-img" :src="httpsUrl + el.url" mode="aspectFill" /></view>
				</swiper-item>
			</swiper>
			<image class="img" v-else :src="item.projectImg" role="img" mode="aspectFill"></image>
			<view class="pannel-title">
				<view class="txt ellipsis">{{item.address}}工程进度表</view>
				<view class="tag" :class="[item.status==2&&'success',item.status==3&&'fail',item.status==1&&'warning']">
					<text v-if="item.status==0">未开始</text>
					<text v-if="item.status==1">进行中</text>
					<text v-if="item.status==2">已完成</text>
					<text v-if="item.status==3">已取消</text>
				</view>
			</view>
		</view>
		
		<view class="pannel-wrap">
			<view class="">管理员：{{item.name}} {{item.mobel}}</view>
			<!-- <view class="mt10 gray">项目说明文字内容项目说明文字内容项目说明文字内容项目说明文字内容项目说明文字内容项目说明文字内容项目说明文字内容</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: 'projectItem',
		props: {
			item: {
				type: Object,
				default: ()=>{}
			}
		},
		data() {
			return {				
				httpsUrl: ''
			}
		}, 
		computed: {
		},
		created(){
			this.httpsUrl = this.$httpsUrl
		},
		methods: {
           	openPage(){
				uni.navigateTo({
					url: './speed',
				})
            },
		}
	}
</script>


<style lang="scss" scoped>
	$theme-color: #f40;
	.gray{ color: #999; }
	.mt10{margin-top: 10rpx;}
	.ellipsis {
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
	}
	.pannel{
		background: #fff;
		font-size: 28rpx;
		border-radius: 10rpx;
		overflow: hidden;
		box-shadow: 0 5rpx 10rpx rgba($color: #000000, $alpha: .05);
		&-swiper{
			height: 100%;
			overflow: hidden;
		}
		&-img{
			position: relative;
			height: 360rpx;
			.img{
				width: 100%;
				height: 100%;
				display: block;
			}
		}
		&-title{
			position: absolute;
			bottom: 0;
			left: 0;
			right: 0;
			font-size: 32rpx;
			padding: 20rpx 20rpx;
			color: #fff;
			// background-color: rgba($color: #000000, $alpha: .5);
			background-image: linear-gradient(rgba($color: #000000, $alpha: .1), rgba($color: #000000, $alpha: .5));
			display: flex;
			align-items: center;
			justify-content: space-between;
			.txt{
				flex: 1;
			}
			.tag{
				font-size: 24rpx;
				background-color: rgba($color: #fff, $alpha: .2);
				padding: 5rpx 20rpx;
				border-radius: 50rpx;
				display: flex;
				align-items: center;
				&::before{
					display: inline-block;
					content: '';
					width: 10rpx;
					height: 10rpx;
					border-radius: 50%;
					background-color: #fff;
					margin-right: 10rpx;
				}
				&.success{
					color: #4eff74;
					&::before{
						background-color: #2dda52;
					}
				}
				&.fail{
					color: #ff2222;
					&::before{
						background-color: #ff4747;
					}
				}
				&.warning{
					color: #f4ff47;
					&::before{
						background-color: #f4ff47;
					}
				}
			}
		}
		&-wrap{
			padding: 20rpx;
			font-size: 26rpx;
		}
	}
	.swiper-wrap{
		height: 100%;
		width: 100%;
	}
	.swiper-img{
		height: 100%;
		width: 100%;
	}
</style>
